import request from '@/utils/request'

const carouselApi = {
  // 轮播图列表
  getCarouselList: () => {
    return request({
      url: '/mall/banner/page',
      method: 'GET'
    })
  },
  // 新增轮播图
  addCarouselItem: (data) => {
    return request({
      url: '/mall/banner/create',
      method: 'POST',
      data
    })
  },
  // 修改轮播图
  updateCarouselItem: (data) => {
    return request({
      url: `/mall/banner/update`,
      method: 'PUT',
      data
    })
  },
  // 删除轮播图
  deleteCarouselItem: (id) => {
    return request({
      url: `/mall/banner/delete?id=${id}`,
      method: 'DELETE'
    })
  },
}
export default carouselApi